home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / DigitalSignature.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  18.0 KB  |  541 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        DigitalSignature.a
  3. ;
  4. ;    Contains:    Digital Signature Interfaces.
  5. ;
  6. ;    Version:    Technology:    AOCE toolbox 1.02
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__DIGITALSIGNATURE__') = 'UNDEFINED' THEN
  21. __DIGITALSIGNATURE__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  30.     include 'Memory.a'
  31.     ENDIF
  32. ;        include 'MixedMode.a'                                        ;
  33.  
  34.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  35.     include 'Files.a'
  36.     ENDIF
  37. ;        include 'OSUtils.a'                                        ;
  38. ;        include 'Finder.a'                                            ;
  39.  
  40. kSIGNewContext                    EQU        1900
  41. kSIGDisposeContext                EQU        1901
  42. kSIGSignPrepare                    EQU        1902
  43. kSIGSign                        EQU        1903
  44. kSIGVerifyPrepare                EQU        1904
  45. kSIGVerify                        EQU        1905
  46. kSIGDigestPrepare                EQU        1906
  47. kSIGDigest                        EQU        1907
  48. kSIGProcessData                    EQU        1908
  49. kSIGShowSigner                    EQU        1909
  50. kSIGGetSignerInfo                EQU        1910
  51. kSIGGetCertInfo                    EQU        1911
  52. kSIGGetCertNameAttributes        EQU        1912
  53. kSIGGetCertIssuerNameAttributes    EQU        1913
  54. kSIGFileIsSigned                EQU        2500
  55. kSIGSignFile                    EQU        2501
  56. kSIGVerifyFile                    EQU        2502
  57.  
  58. kSIGCountryCode                    EQU        0
  59. kSIGOrganization                EQU        1
  60. kSIGStreetAddress                EQU        2
  61. kSIGState                        EQU        3
  62. kSIGLocality                    EQU        4
  63. kSIGCommonName                    EQU        5
  64. kSIGTitle                        EQU        6
  65. kSIGOrganizationUnit            EQU        7
  66. kSIGPostalCode                    EQU        8
  67.  
  68. ; typedef unsigned short     SIGNameAttributeType
  69. ;Certificate status codes returned in SIGCertInfo or SIGSignerInfo from
  70. ;either SIGGetCertInfo or SIGGetSignerInfo respectively. kSIGValid means that
  71. ;the certificate is currently valid. kSIGPending means the certificate is
  72. ;currently not valid - but will be.  kSIGExpired means the certificate has
  73. ;expired. A time is always associated with a SIGCertStatus.  In each case the
  74. ;time has a specific interpretation.  When the status is kSIGValid the time is
  75. ;when the certificate will expire. When the status is kSIGPending the time is
  76. ;when the certificate will become valid. When the status is kSIGExpired the time
  77. ;is when the certificate expired. In the SIGCertInfo structure, the startDate
  78. ;and endDate fields hold the appropriate date information.  In the SIGSignerInfo
  79. ;structure, this information is provided in the certSetStatusTime field. In the
  80. ;SIGSignerInfo struct, the status time is actually represented by the SIGSignatureStatus
  81. ;field which can contain any of the types below. NOTE: The only time you will get 
  82. ;a kSIGInvalid status is when it pertains to a SIGSignatureStatus field and only when
  83. ;you get a signature that was created after the certificates expiration date, something
  84. ;we are not allowing on the Mac but that may not be restricted on other platforms. Also, 
  85. ;it will not be possible to get a kSIGPending value for SIGSignatureStatus on the Mac but
  86. ;possibly allowed by other platforms.
  87. ;
  88. ; Values for SIGCertStatus or SIGSignatureStatus 
  89.  
  90. kSIGValid                        EQU        0                    ; possible for either a SIGCertStatus or SIGSignatureStatus 
  91. kSIGPending                        EQU        1                    ; possible for either a SIGCertStatus or SIGSignatureStatus 
  92. kSIGExpired                        EQU        2                    ; possible for either a SIGCertStatus or SIGSignatureStatus
  93. ;    * possible only for a SIGSignatureStatus 
  94. kSIGInvalid                        EQU        3
  95.  
  96. ; typedef unsigned short     SIGCertStatus
  97. ; typedef unsigned short     SIGSignatureStatus
  98. ; Gestalt selector code - returns toolbox version in low-order word 
  99.  
  100. gestaltDigitalSignatureVersion    EQU        'dsig'
  101.  
  102. ; Number of bytes needed for a digest record when using SIGDigest 
  103. kSIGDigestSize                    EQU        16
  104.  
  105. ; typedef Byte                 SIGDigestData[kSIGDigestSize], *SIGDigestDataPtr
  106. SIGCertInfo             RECORD    0
  107. startDate                 ds.l   1        ; offset: $0 (0)        ; cert start validity date 
  108. endDate                     ds.l   1        ; offset: $4 (4)        ; cert end validity date 
  109. certStatus                 ds.w   1        ; offset: $8 (8)        ; see comment on SIGCertStatus for definition 
  110. certAttributeCount         ds.l   1        ; offset: $A (10)        ; number of name attributes in this cert 
  111. issuerAttributeCount     ds.l   1        ; offset: $E (14)        ; number of name attributes in this certs issuer 
  112. serialNumber             ds.l   64        ; offset: $12 (18)        ; cert serial number 
  113. sizeof                     EQU *            ; size:   $112 (274)
  114.                         ENDR
  115.  
  116. ; typedef struct SIGCertInfo  SIGCertInfo
  117. ; typedef SIGCertInfo         *SIGCertInfoPtr
  118. SIGSignerInfo             RECORD    0
  119. signingTime                 ds.l   1        ; offset: $0 (0)        ; time of signing 
  120. certCount                 ds.l   1        ; offset: $4 (4)        ; number of certificates in the cert set 
  121. certSetStatusTime         ds.l   1        ; offset: $8 (8)        ; Worst cert status time. See comment on SIGCertStatus for definition 
  122. signatureStatus             ds.w   1        ; offset: $C (12)        ; The status of the signature. See comment on SIGCertStatus for definition
  123. sizeof                     EQU *            ; size:   $E (14)
  124.                         ENDR
  125.  
  126. ; typedef struct SIGSignerInfo  SIGSignerInfo
  127. ; typedef SIGSignerInfo     *SIGSignerInfoPtr
  128. SIGNameAttributesInfo     RECORD    0
  129. onNewLevel                 ds.b   1        ; offset: $0 (0)
  130. filler1                     ds.b   1        ; offset: $1 (1)
  131. attributeType             ds.w   1        ; offset: $2 (2)
  132. attributeScript             ds.w   1        ; offset: $4 (4)
  133. attribute                 ds.l   64        ; offset: $6 (6)
  134. sizeof                     EQU *            ; size:   $106 (262)
  135.                         ENDR
  136.  
  137. ; typedef struct SIGNameAttributesInfo  SIGNameAttributesInfo
  138. ; typedef SIGNameAttributesInfo  *SIGNameAttributesInfoPtr
  139. ; typedef Ptr                 SIGContextPtr
  140. ; typedef Ptr                 SIGSignaturePtr
  141. ;
  142. ;Certificates are always in order. That is, the signers cert is always 0, the
  143. ;issuer of the signers cert is always 1 etc… to the number of certificates-1.
  144. ;You can use this constant for readability in your code.
  145. ;
  146.  
  147. kSIGSignerCertIndex                EQU        0
  148.  
  149. ;
  150. ;Call back procedure supplied by developer, return false to cancel the current
  151. ;process.
  152. ;
  153. ;
  154. ;Resource id's of standard signature icon suite, all sizes and colors are available.
  155. ;
  156. kSIGSignatureIconResID            EQU        -16800
  157. kSIGValidSignatureIconResID        EQU        -16799
  158. kSIGInvalidSignatureIconResID    EQU        -16798
  159.  
  160. ; ——————————————————————————————— CONTEXT CALLS ——————————————————————————————— 
  161. ;To use the Digital Signature toolbox you will need a SIGContextPtr.  To create
  162. ;a SIGContextPtr you simply call SIGNewContext and it will create and initialize
  163. ;a context for you.  To free the memory occupied by the context and invalidate
  164. ;its internal data, call SIGDisposeContext. An initialized context has no notion
  165. ;of the type of operation it will be performing however, once you call
  166. ;SIGSignPrepare SIGVerifyPrepare, or SIGDigestPrepare, the contexts operation
  167. ;type is set and to switch  to another type of operation will require creating a
  168. ;new context. Be sure to pass the same context to corresponding toolbox calls
  169. ;(ie SIGSignPrepare, SIGProcessData, SIGSign)  in other words mixing lets say
  170. ;signing and verify calls with the same context is not allowed.
  171. ;
  172. ;
  173. ; pascal OSErr SIGNewContext(SIGContextPtr *context)
  174. ;
  175.     IF ¬ GENERATINGCFM THEN
  176.         Macro
  177.         _SIGNewContext
  178.             dc.w     $203C
  179.             dc.w     $0002
  180.             dc.w     $076C
  181.             dc.w     $AA5D
  182.         EndM
  183.     ELSE
  184.         IMPORT_CFM_FUNCTION    SIGNewContext
  185.     ENDIF
  186.  
  187. ;
  188. ; pascal OSErr SIGDisposeContext(SIGContextPtr context)
  189. ;
  190.     IF ¬ GENERATINGCFM THEN
  191.         Macro
  192.         _SIGDisposeContext
  193.             dc.w     $203C
  194.             dc.w     $0002
  195.             dc.w     $076D
  196.             dc.w     $AA5D
  197.         EndM
  198.     ELSE
  199.         IMPORT_CFM_FUNCTION    SIGDisposeContext
  200.     ENDIF
  201.  
  202. ; ——————————————————————————————— SIGNING CALLS ——————————————————————————————— 
  203. ;Once you have created a SIGContextPtr, you create a signature by calling
  204. ;SIGSignPrepare once, followed by n calls to SIGProcessData, followed by one call
  205. ;toRcpt SIGSign. To create another signature on different data but for the same
  206. ;signer, don't dispose of the context and call SIGProcessData for the new data
  207. ;followed by a call SIGSign again. In this case the signer will not be prompted
  208. ;for their signer and password again as it was already provided.  Once you call
  209. ;SIGDisposeContext, all signer information will be cleared out of the context and
  210. ;the signer will be re-prompted.  The signer file FSSpecPtr should be set to nil
  211. ;if you want the toolbox to use the last signer by default or prompt for a signer
  212. ;if none exists.  The prompt parameter can be used to pass a string to be displayed
  213. ;in the dialog that prompts the user for their password.  If the substring "^1"
  214. ;(without the quotes) is in the prompt string, then the toolbox will replace it
  215. ;with the name of the signer from the signer selected by the user.  If an empty
  216. ;string is passed, the following default string will be sent to the toolbox
  217. ;"\pSigning as ^1.".  You can call any of the utility routines after SIGSignPrepare
  218. ;or SIGSign to get information about the signer or certs.
  219. ;
  220. ;
  221. ; pascal OSErr SIGSignPrepare(SIGContextPtr context, const FSSpec *signerFile, ConstStr255Param prompt, Size *signatureSize)
  222. ;
  223.     IF ¬ GENERATINGCFM THEN
  224.         Macro
  225.         _SIGSignPrepare
  226.             dc.w     $203C
  227.             dc.w     $0008
  228.             dc.w     $076E
  229.             dc.w     $AA5D
  230.         EndM
  231.     ELSE
  232.         IMPORT_CFM_FUNCTION    SIGSignPrepare
  233.     ENDIF
  234.  
  235. ;
  236. ; pascal OSErr SIGSign(SIGContextPtr context, SIGSignaturePtr signature, SIGStatusUPP statusProc)
  237. ;
  238.     IF ¬ GENERATINGCFM THEN
  239.         Macro
  240.         _SIGSign
  241.             dc.w     $203C
  242.             dc.w     $0006
  243.             dc.w     $076F
  244.             dc.w     $AA5D
  245.         EndM
  246.     ELSE
  247.         IMPORT_CFM_FUNCTION    SIGSign
  248.     ENDIF
  249.  
  250. ; ——————————————————————————————— VERIFYING CALLS ——————————————————————————————— 
  251. ;Once you have created a SIGContextPtr, you verify a signature by calling
  252. ;SIGVerifyPrepare  once, followed by n calls to SIGProcessData, followed by one
  253. ;call to SIGVerify. Check the return code from SIGVerify to see if the signature
  254. ;verified or not (noErr is returned on  success otherwise the appropriate error
  255. ;code).  Upon successfull verification, you can call any of the utility routines
  256. ;toRcpt find out who signed the data.
  257. ;
  258. ;
  259. ; pascal OSErr SIGVerifyPrepare(SIGContextPtr context, SIGSignaturePtr signature, Size signatureSize, SIGStatusUPP statusProc)
  260. ;
  261.     IF ¬ GENERATINGCFM THEN
  262.         Macro
  263.         _SIGVerifyPrepare
  264.             dc.w     $203C
  265.             dc.w     $0008
  266.             dc.w     $0770
  267.             dc.w     $AA5D
  268.         EndM
  269.     ELSE
  270.         IMPORT_CFM_FUNCTION    SIGVerifyPrepare
  271.     ENDIF
  272.  
  273. ;
  274. ; pascal OSErr SIGVerify(SIGContextPtr context)
  275. ;
  276.     IF ¬ GENERATINGCFM THEN
  277.         Macro
  278.         _SIGVerify
  279.             dc.w     $203C
  280.             dc.w     $0002
  281.             dc.w     $0771
  282.             dc.w     $AA5D
  283.         EndM
  284.     ELSE
  285.         IMPORT_CFM_FUNCTION    SIGVerify
  286.     ENDIF
  287.  
  288. ; —————————————————————————————— DIGESTING CALLS —————————————————————————————— 
  289. ;Once you have created a SIGContextPtr, you create a digest by calling
  290. ;SIGDigestPrepare once, followed by n calls to SIGProcessData, followed by one
  291. ;call to SIGDigest.  You can dispose of the context after SIGDigest as the
  292. ;SIGDigestData does not reference back into it.  SIGDigest returns the digest in
  293. ;digest.
  294. ;
  295. ;
  296. ; pascal OSErr SIGDigestPrepare(SIGContextPtr context)
  297. ;
  298.     IF ¬ GENERATINGCFM THEN
  299.         Macro
  300.         _SIGDigestPrepare
  301.             dc.w     $203C
  302.             dc.w     $0002
  303.             dc.w     $0772
  304.             dc.w     $AA5D
  305.         EndM
  306.     ELSE
  307.         IMPORT_CFM_FUNCTION    SIGDigestPrepare
  308.     ENDIF
  309.  
  310. ;
  311. ; pascal OSErr SIGDigest(SIGContextPtr context, SIGDigestData digest)
  312. ;
  313.     IF ¬ GENERATINGCFM THEN
  314.         Macro
  315.         _SIGDigest
  316.             dc.w     $203C
  317.             dc.w     $0004
  318.             dc.w     $0773
  319.             dc.w     $AA5D
  320.         EndM
  321.     ELSE
  322.         IMPORT_CFM_FUNCTION    SIGDigest
  323.     ENDIF
  324.  
  325. ; —————————————————————————————— PROCESSING DATA —————————————————————————————— 
  326. ;To process data during a digest, sign, or verify operation call SIGProcessData
  327. ;as many times as necessary and with any sized blocks of data.  The data needs to
  328. ;be processed in the same order during corresponding sign and verify operations
  329. ;but does not need to be processed in the same sized chunks (i.e., the toolbox
  330. ;just sees it as a continuous bit stream).
  331. ;
  332. ;
  333. ; pascal OSErr SIGProcessData(SIGContextPtr context, const void *data, Size dataSize)
  334. ;
  335.     IF ¬ GENERATINGCFM THEN
  336.         Macro
  337.         _SIGProcessData
  338.             dc.w     $203C
  339.             dc.w     $0006
  340.             dc.w     $0774
  341.             dc.w     $AA5D
  342.         EndM
  343.     ELSE
  344.         IMPORT_CFM_FUNCTION    SIGProcessData
  345.     ENDIF
  346.  
  347. ; ——————————————————————————————— UTILITY CALLS ——————————————————————————————— 
  348. ;Given a context that has successfully performed a verification SIGShowSigner
  349. ;will  display a modal dialog with the entire distinguished name of the person
  350. ;who signed the data. the prompt (if supplied) will appear at the top of the
  351. ;dialog.  If no prompt is specified, the default prompt "\pVerification
  352. ;Successfull." will appear.
  353. ;
  354. ;Given a context that has been populated by calling SIGSignPrepare, SIGSign or a
  355. ;successful SIGVerify, you can make the remaining utility calls:
  356. ;
  357. ;SIGGetSignerInfo will return the SignerInfo record.  The certCount can be used
  358. ;toRcpt index into the certificate set when calling SIGGetCertInfo,
  359. ;SIGGetCertNameAttributes or SIGGetCertIssuerNameAttributes. The signingTime is
  360. ;only defined if the call is made after SIGSign  or SIGVerify. The certSetStatus
  361. ;will tell you the best status of the entire certificate set while
  362. ;certSetStatusTime will correspond to the time associated with that status (see
  363. ;definitions above).
  364. ;
  365. ;SIGGetCertInfo will return the SIGCertInfo record when given a valid index into
  366. ;the cert set in  certIndex.  Note: The cert at index kSIGSignerCertIndex is
  367. ;always the signers certificate.  The  serial number, start date and end date
  368. ;are there should you wish to display that info.  The  certAttributeCount and
  369. ;issuerAttributeCount provide the number of parts in the name of that certificate
  370. ;or that certificates issuer respectively.  You use these numbers to index into
  371. ;either SIGGetCertNameAttributes or SIGGetCertIssuerNameAttributes to retrieve
  372. ;the name. The certStatus will tell you the status of the certificate while
  373. ;certStatusTime will correspond to the time associated with that status (see
  374. ;definitions above).
  375. ;
  376. ;SIGGetCertNameAttributes and SIGGetCertIssuerNameAttributes return name parts
  377. ;of the certificate at  certIndex and attributeIndex.  The newLevel return value
  378. ;tells you wether the name attribute returned is at the same level in the name
  379. ;hierarchy as the previous attribute.  The type return value tells you  the type
  380. ;of attribute returned. nameAttribute is the actual string containing the name
  381. ;attribute.   So, if you wanted to display the entire distinguished name of the
  382. ;person who's signature was just validated you could do something like this;
  383. ;
  384. ;    (…… variable declarations and verification code would preceed this sample ……)
  385. ;
  386. ;    error = SIGGetCertInfo(verifyContext, kSIGSignerCertIndex, &certInfo);
  387. ;    HandleErr(error);
  388. ;
  389. ;    for (i = 0; i <= certInfo.certAttributeCount-1; i++)
  390. ;        {
  391. ;        error = SIGGetCertNameAttributes(
  392. ;            verifyContext, kSIGSignerCertIndex, i, &newLevel, &type, theAttribute);
  393. ;        HandleErr(error);
  394. ;        DisplayNamePart(theAttribute, type, newLevel);
  395. ;        }
  396. ;
  397. ;
  398. ; pascal OSErr SIGShowSigner(SIGContextPtr context, ConstStr255Param prompt)
  399. ;
  400.     IF ¬ GENERATINGCFM THEN
  401.         Macro
  402.         _SIGShowSigner
  403.             dc.w     $203C
  404.             dc.w     $0004
  405.             dc.w     $0775
  406.             dc.w     $AA5D
  407.         EndM
  408.     ELSE
  409.         IMPORT_CFM_FUNCTION    SIGShowSigner
  410.     ENDIF
  411.  
  412. ;
  413. ; pascal OSErr SIGGetSignerInfo(SIGContextPtr context, SIGSignerInfo *signerInfo)
  414. ;
  415.     IF ¬ GENERATINGCFM THEN
  416.         Macro
  417.         _SIGGetSignerInfo
  418.             dc.w     $203C
  419.             dc.w     $0004
  420.             dc.w     $0776
  421.             dc.w     $AA5D
  422.         EndM
  423.     ELSE
  424.         IMPORT_CFM_FUNCTION    SIGGetSignerInfo
  425.     ENDIF
  426.  
  427. ;
  428. ; pascal OSErr SIGGetCertInfo(SIGContextPtr context, unsigned long certIndex, SIGCertInfo *certInfo)
  429. ;
  430.     IF ¬ GENERATINGCFM THEN
  431.         Macro
  432.         _SIGGetCertInfo
  433.             dc.w     $203C
  434.             dc.w     $0006
  435.             dc.w     $0777
  436.             dc.w     $AA5D
  437.         EndM
  438.     ELSE
  439.         IMPORT_CFM_FUNCTION    SIGGetCertInfo
  440.     ENDIF
  441.  
  442. ;
  443. ; pascal OSErr SIGGetCertNameAttributes(SIGContextPtr context, unsigned long certIndex, unsigned long attributeIndex, SIGNameAttributesInfo *attributeInfo)
  444. ;
  445.     IF ¬ GENERATINGCFM THEN
  446.         Macro
  447.         _SIGGetCertNameAttributes
  448.             dc.w     $203C
  449.             dc.w     $0008
  450.             dc.w     $0778
  451.             dc.w     $AA5D
  452.         EndM
  453.     ELSE
  454.         IMPORT_CFM_FUNCTION    SIGGetCertNameAttributes
  455.     ENDIF
  456.  
  457. ;
  458. ; pascal OSErr SIGGetCertIssuerNameAttributes(SIGContextPtr context, unsigned long certIndex, unsigned long attributeIndex, SIGNameAttributesInfo *attributeInfo)
  459. ;
  460.     IF ¬ GENERATINGCFM THEN
  461.         Macro
  462.         _SIGGetCertIssuerNameAttributes
  463.             dc.w     $203C
  464.             dc.w     $0008
  465.             dc.w     $0779
  466.             dc.w     $AA5D
  467.         EndM
  468.     ELSE
  469.         IMPORT_CFM_FUNCTION    SIGGetCertIssuerNameAttributes
  470.     ENDIF
  471.  
  472. ; ——————————————————————————— FILE SIGN & VERIFY CALLS —————————————————————————— 
  473. ;These calls allow you to detect the presence of a standard signtaure in a file as 
  474. ;well as sign and verify files in a standard way.  An example of this is the Finder, 
  475. ;which uses these calls to allow the user to "drop sign" a file.
  476. ;
  477. ;To detect if a file is signed in the standard way, pass the FSSpec of the file to SIGFileIsSigned.
  478. ;A result of noErr means the file is in fact signed, otherwise, a kSIGNoSignature error will
  479. ;be returned.
  480. ;
  481. ;Once you have created a SIGContextPtr, you can make calls to either sign or verify a file in
  482. ;a standard way: 
  483. ;
  484. ;To sign a file, call SIGSignPrepare followed by 'n' number of calls to SIGSignFile,
  485. ;passing it the file spec for each file you wish to sign in turn.  You supply the context, the signature 
  486. ;size that was returned from SIGSignPrepare and an optional call back proc.  The call will take care of all
  487. ;the processing of data and affixing the signature to the file. If a signature already exists in the file, 
  488. ;it is replaced with the newly created signature.
  489. ;
  490. ;To verify a file that was signed using SIGSignFile, call SIGVerifyFile passing it a new context and 
  491. ;the file spec.  Once this call has completed, if the verification is successfull, you can pass the context 
  492. ;to SIGShowSigner to display the name of the person who signed the file.
  493. ;
  494. ;
  495. ; pascal OSErr SIGFileIsSigned(const FSSpec *fileSpec)
  496. ;
  497.     IF ¬ GENERATINGCFM THEN
  498.         Macro
  499.         _SIGFileIsSigned
  500.             dc.w     $203C
  501.             dc.w     $0002
  502.             dc.w     $09C4
  503.             dc.w     $AA5D
  504.         EndM
  505.     ELSE
  506.         IMPORT_CFM_FUNCTION    SIGFileIsSigned
  507.     ENDIF
  508.  
  509. ;
  510. ; pascal OSErr SIGSignFile(SIGContextPtr context, Size signatureSize, const FSSpec *fileSpec, SIGStatusUPP statusProc)
  511. ;
  512.     IF ¬ GENERATINGCFM THEN
  513.         Macro
  514.         _SIGSignFile
  515.             dc.w     $203C
  516.             dc.w     $0008
  517.             dc.w     $09C5
  518.             dc.w     $AA5D
  519.         EndM
  520.     ELSE
  521.         IMPORT_CFM_FUNCTION    SIGSignFile
  522.     ENDIF
  523.  
  524. ;
  525. ; pascal OSErr SIGVerifyFile(SIGContextPtr context, const FSSpec *fileSpec, SIGStatusUPP statusProc)
  526. ;
  527.     IF ¬ GENERATINGCFM THEN
  528.         Macro
  529.         _SIGVerifyFile
  530.             dc.w     $203C
  531.             dc.w     $0006
  532.             dc.w     $09C6
  533.             dc.w     $AA5D
  534.         EndM
  535.     ELSE
  536.         IMPORT_CFM_FUNCTION    SIGVerifyFile
  537.     ENDIF
  538.  
  539.     ENDIF ; __DIGITALSIGNATURE__
  540.